<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id = "app">
    <h4 v-red>你好世界</h4>
    <h4 v-color="'yellowgreen'">你好世界</h4>
  </div>
  <script src="../js/vue.js"></script>
  <script>

    Vue.directive('red',{
      bind(el){
        el.style.color = 'red';
      }
    })
    
    Vue.directive('color',{
      bind(el,bindings){
        el.style.color = bindings.value || 'red';
      }
    })

    const app = new Vue({
      el: '#app',
      data: {
        
      }
    })
  </script>
</body>
</html>